package com.feizhaiyou.demo.service.impl;

import com.feizhaiyou.demo.anno.DataSource;
import com.feizhaiyou.demo.dao.DataSource1Mapper;
import com.feizhaiyou.demo.enums.DataSourceType;
import com.feizhaiyou.demo.service.DataSource1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @author Jason
 */
@Service
// TODO 不使用@DataSource指定key则默认MASTER数据源
//@DataSource(value = DataSourceType.MASTER)
public class DataSource1ServiceImpl implements DataSource1Service {
    @Autowired
    private DataSource1Mapper dataSource1Mapper;
    @Override
    public List<HashMap> getData() {
        return dataSource1Mapper.getData();
    }
}
